<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			var aa = [1,2,3,4,77,55,33,88,22]; //1 2 3 4 55 33 77

			for(var i=0;i<aa.length;i++){
				for(var j=i+1;j<aa.length;j++){
					var box;
					if(aa[i]>aa[j]){
						box = aa[i];
						aa[i] = aa[j];
						aa[j] = box;
					}
//					var box;
//					if(aa[i]>aa[i+1]){
//						box = aa[i];
//						aa[i] = aa[i+1];
//						aa[i+1] =box;
//					}
				}
				
			}
				//alert(aa[aa.length-1]);
				document.write(aa);

			
			

		
            
            
		</script>
            

	</body>
</html>
